<?php
$this->load->view("header");
?>
<div id="main_content">
<div class="top_margin"></div>


<?php
$this->load->view("bookiki/leftcolumn");
?>

<div class="homepage_mid_column">
<div class="book_charts">
<div class="book_chart_title"><a href="<?=site_url()?>/rank/sale">最新出售</a></div>
<table class="chart_listing_preview">
<!--freebook_song_result_s9f0d0628cbeeb14f-->
<tbody>
    <?php
    $rank=1;
     if($recent_salepost!=null)
    foreach($recent_salepost as $post2){
    ?>
    <tr onmouseover="this.style.background = &quot;#f2f3f4&quot;;" onmouseout="this.style.background = &quot;#ffffff&quot;;" >
    <td class="ranking"><?=$rank++;?></td>
    <td class="item_title">
    <a href="<?=site_url()?>/post/salepost_detail?userid=<?=$post2->user_id?>&bookid=<?=$post2->book_id?>">
    <?php
        $title=$post2->book_title;
        if(mb_strlen($title,"UTF-8")>17)
          echo mb_substr($title,0,17,"UTF-8")."..";
        else
          echo $title;
    ?>
    </a>
    &nbsp;&nbsp;￥<?=$post2->price?>&nbsp;</td>
     <td class="item_artist"><div class="sub_link">
     <a href="<?=site_url()?>/bookiki/entershop?go=yes&id=<?=$post2->user_id?>" style="white-space:nowrap;">
     <?php
        $user=$post2->user_id;
        if(mb_strlen($user,"UTF-8")>8)
          echo mb_substr($user,0,8,"UTF-8")."..";
        else
          echo $user;
     ?>
     </a>
    </div></td>
    </tr>
    <?php
     }?>
</tbody>
</table>
</div><!--book_charts中间偏左的排行榜-->



<div class="book_charts">
<div class="book_chart_title"><a href="<?=site_url()?>/rank/wanted">最新求购</a></div>
<table class="chart_listing_preview">
<!--freebook_song_result_s9f0d0628cbeeb14f-->
<tbody>
    <?php
    $rank=1;
    if($recent_wantedpost!=null)
    foreach($recent_wantedpost as $post){
    ?>
    <tr onmouseover="this.style.background = &quot;#f2f3f4&quot;;" onmouseout="this.style.background = &quot;#ffffff&quot;;" >
    <td class="ranking"><?=$rank++;?></td>
    <td class="item_title">
     <a href="<?=site_url()?>/post/wantedpost_detail?userid=<?=$post->user_id?>&bookid=<?=$post->book_id?>">
    <?php
        $title=$post->book_title;
        if(mb_strlen($title,"UTF-8")>14)
          echo mb_substr($title,0,14,"UTF-8")."...";
        else
          echo $title;
    ?>
    </a>&nbsp;&nbsp;￥<?=$post->start_price?>-￥<?=$post->end_price?>&nbsp;</td>
     <td class="item_artist"><div class="sub_link">
     <a href="<?=site_url()?>/bookiki/entershop?go=yes&id=<?=$post->user_id?>" style="white-space:nowrap;">
     <?php
        $user=$post->user_id;
        if(mb_strlen($user,"UTF-8")>8)
          echo mb_substr($user,0,8,"UTF-8")."..";
        else
          echo $user;
     ?>
     </a>
    </div></td>
    </tr>
    <?php
     }?>
</tbody>
</table>
</div><!--book_charts中间偏右的排行榜-->




</div>  <!--homepage_mid_column-->

<div class="homepage_right_column">
<div class="pick_song">
    <a href="<?=site_url()?>/bookiki/faq"><img alt="" align="center" src="<?=base_url()?>images/process2.png"></a>
</div>
<div class="chart_listing_dir" style="width:250px;margin-top:10px;">
<div class="box_top"><span class="box_title" >最热二手书:</span></div>
<div class="chart_listing_content_homepage">
<table>
<!--freebook_song_result_s9f0d0628cbeeb14f-->
<tbody>
    <?php
    $rank=1;
     if($hottest_book!=null)
    foreach($hottest_book as $book){
    ?>
    <tr onmouseover="this.style.background = &quot;#f2f3f4&quot;;" onmouseout="this.style.background = &quot;#ffffff&quot;;" >
    <td class="ranking"><?=$rank++;?></td>
    <td class="item_title"><a href="<?=site_url()?>/post/getpost_ofbook?go=yes&bookid=<?=$book->id?>">
    <?
       $title=$book->title;
        if(mb_strlen($title,"UTF-8")>15)
          echo mb_substr($title,0,15,"UTF-8")."..";
        else
          echo $title;
    ?>
    </a></td>
     <!--<td class="item_artist"><div class="sub_link">
     <a href="" style="white-space:nowrap;"><?=$book->numdeals+$book->num_sales+$book->num_wanted?></a>
    </div></td>-->
    </tr>
    <?php
    if($rank==9)
      break;
     }?>
</tbody>
</table>
<a href="<?=site_url()?>/rank/hotbook">更多热门旧书</a>
</div>
</div>

<div class="chart_listing_dir" style="width:250px;margin-top:10px"><div class="box_top"><span class="box_title">最热二手书店:</span></div>
<div class="chart_listing_content_homepage" >
<table >
<tbody>
    <?php
    $rank=1;
    if($hottest_shop!=null)
    foreach($hottest_shop as $shop){
    ?>
    <tr onmouseover="this.style.background = &quot;#f2f3f4&quot;;" onmouseout="this.style.background = &quot;#ffffff&quot;;" >
    <td class="ranking"><?=$rank++;?></td>
    <td class="item_title"><a href="<?=site_url()?>/bookiki/entershop?go=yes&id=<?=$shop->id?>">
    <?
        if($shop->shopname!=null)
           $title=$shop->shopname;
        else
          $title=$shop->id;
        if(mb_strlen($title,"UTF-8")>13)
          echo mb_substr($title,0,15,"UTF-8")."..";
        else
          echo $title;
    ?>
    </a></td>
     <td class="item_artist"><div class="sub_link">
     <a href="" style="white-space:nowrap;"><?=$shop->numsales+$shop->numwanted+$shop->numsaledeals+$shop->numwanteddeals?></a>
    </div></td>
    </tr>
    <?php
    if ($rank>=5)
       break;
     }?>
</tbody>
</table>
</div>
</div>
</div> <!--homepage_right_column-->

<div class="bottom_margin"></div>
<div class="div-footer"><div class="div-footer-intl-links"></div>
<div class="div-footer-links"></div>
<?=anchor('bookiki/index', '首页');?> - <?=anchor('bookiki/about', '关于书易');?> - <?=anchor('bookiki/about_eng', 'About Bookiki');?> - <?=anchor('bookiki/faq', '使用帮助');?>
&nbsp;-&nbsp;©2009&nbsp;-&nbsp;
<a href="http://www.miibeian.gov.cn/">浙ICP备09067748号</a>
</div>  <!--div-footer-->


</div> <!--main_content-->

</div>  <!--end of body agent-->
</body>
</html>
